home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 154
/
154.d81
/
six pawns
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
6KB
|
184 lines
10 poke53281,10:poke53280,0:poke646,0:poke53272,31
12 dv=peek(186):ifdv<8thendv=8
20 :
30 rem title screen
40 :
50 print"[147][176][192][192][174] [146][176][192][192][174] [146][176][192][192][174] [146][176][192][192][174] [146][176][192][192][174] [146][176][192][192][174]";
60 print"[221] [173][192][192][192][189] [173][192][192][192][189] [173][192][192][192][192][189] [173][192][192][192][189] [173][192][192][192][189] [221]";
70 print"[221] [162] [146][162] [176][178][178][174][176][174][176][174][176][174][144] [221]";
80 print"[173][174] [146] [221][221][173][189][221][221][173][219][219][189][144] [176][189]";
90 print" [146][221] [190] [188][146] [173][177][178][174][221][221] [221][221][144] [221] [146]";
100 print" [146][221] [172][190] [188][146][187] [176][174][221][221][221][221][176][219][219][174][144] [221] [146]";
110 print"[176][189] [188] [146][190] [173][177][177][189][173][189][173][189][173][189][144] [173][174]";
120 print"[221] [146] [176][178][178][174][176][178][178][174][176][174] [176][174][176][174][176][174][176][178][178][174][144] [221]";
130 print"[173][174] [146] [221][221][221][221][221][221][221][221][221][221] [221][221][221][173][179][221][221][221][173][189][144] [176][189]";
140 print" [146][221] [172][190] [188][146][187] [221][171][177][189][221][171][179][221][221][221][221][221][221][221] [221][173][177][178][174][144] [221] [146]";
150 print" [146][221] [190] [188][146] [221][221] [221][221][221][221][221][221][221][221][221][221][171][174][221][176][174][221][221][144] [221] [146]";
160 print"[176][189] [187] [172][146] [173][189] [173][189][173][189][173][177][177][177][189][173][189][173][189][173][177][177][189][144] [173][174]";
170 print"[221] [221]";
180 print"[173][174] [176][178][178][174][176][174][176][174][176][178][178][174][176][178][178][174][176][178][178][174] [162] [146][162][144] [176][189]";
190 print" [146][221] [221][221][173][189][221][221][221][221][221][221][173][189][221][221][173][189][221][221][173][189] [146][144] [221] [146]";
200 print" [146][221] [221][221] [221][171][179][221][221][171][192] [173][177][178][174][173][177][178][174] [190] [188][146][144] [221] [146]";
210 print"[176][189] [221][221][176][174][221][221][221][221][221][221][176][174][176][174][221][221][176][174][221][221] [172][190] [188][146][187][144] [173][174]";
220 print"[221] [173][177][177][189][173][189][173][189][173][177][177][189][173][177][177][189][173][177][177][189] [188] [146][190][144] [221]";
230 print"[173][174] [176][178][178][174][176][174][176][174][176][178][178][174][176][178][178][174][176][174] [176][178][178][174] [146][144] [176][189]";
240 print" [146][221] [221][221][221][221][221][221][221][221][173][189][221][221][173][189][221][221][221][221] [221][221][173][189] [146][144] [221] [146]";
250 print" [146][221] [221][171][177][189][221][221][221][221][176][178][177][189][176][178][177][189][221][221] [221][171][192] [172][190] [188][146][187][144] [221] [146]";
260 print"[176][189] [221][221] [221][221][221][221][221][221][176][174][221][221][176][174][221][221][176][174][221][221][176][174] [190] [188][146][144] [173][174]";
270 print"[221] [173][189] [173][177][177][189][173][177][177][189][173][177][177][189][173][177][177][189][173][177][177][189] [187] [172][146][144] [221]";
280 print"[221] [176][192][192][192][174] [176][192][192][192][174] [176][192][192][192][192][174] [176][192][192][192][174] [176][192][192][192][174] [221]";
290 print"[173][192][192][189] [146][173][192][192][189] [146][173][192][192][189] [146][173][192][192][189] [146][173][192][192][189] [146][173][192][189][157][148][192]";
299 fori=217to242:pokei,peek(i)or128:next
300 tq=0:poke53370,0
302 tq=tq+1:geta$:ifa$=""andtq<200then302
304 poke53371,0
310 :
320 rem instruction screen
330 :
340 print"[147][144] [170][146][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174][180] [146]";
350 print"[176][192][192][192][192][192][192][189] [211][201][216] [208][193][215][206][211] [195][200][197][211][211] [208][213][218][218][204][197][144] [173][192][192][192][192][192][192][174]";
360 print"[144] [212]o begin, three black pawns and three
370 [153]" white pawns are positioned on either
380 print" end of a one by seven gameboard grid.
390 [153]" ortantantan=tantantan=tantantan=tantantantan=tantantan=tantantan=tantantan^
400 print" [221][144][172] [146][187][221][144][172] [146][187][221][144][172] [146][187][221] [221][172] [146][187][221][172] [146][187][221][172] [146][187][221]
410 [153]" (NULL)stop* waitrnd(NULL)stop* waitrnd(NULL)stop* waitrnd(NULL) (NULL)* waitrnd(NULL)* waitrnd(NULL)* waitrnd(NULL)
420 print" [173][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][189][144]
430 [153]" (NULL)he three black pawns are permitted to
440 print" move only to the right and the three
450 [153]" white pawns are permitted to move only
460 print" to the left. [208]awns may slide into an
470 [153]" adjacent empty cell or jump over one
480 print" adjacent pawn of opposite color into a
490 [153]" following empty cell.
500 print" [212]he goal is to exchange the positions
510 [153]" of the six pawns with the black pawns
520 print" ending on the right side and the white
530 [153]" pawns ending on the left side.
540 print" [208]ress any key to begin.";
542 fori=217to242:pokei,peek(i)or128:next
550 poke198,0:wait198,1:gets$:poke198,0
560 :
570 rem gameboard screen
580 :
590 print"[147]";:poke53281,0:poke53280,10
592 dv=peek(186):ifdv<8thendv=8
600 m=0:c(0)=2:fori=1to3:c(i)=1:c(i+4)=-1:next:c(4)=0:c(8)=2
610 print"[147][158] [176][192][174][178][176][174][174] [176][192][174][176][192][174][176] [174][176][174][174][176][192][174] ";
620 print" [173][192][174][221][176][219][189] [171][192][189][171][192][179][221][221][221][221][221][221][173][192][174] ";
630 print" [173][192][189][177][173][173][189] [173] [173] [189][173][177][189][173][173][189][173][192][189]
640 [153]" def ortantantantan=tantantantan=tantantantan=tantantantan=tantantantan=tantantantan=tantantantan^ "
650 [153]" def (NULL)1 defwait(NULL)2 defwait(NULL)3 defwait(NULL)4 defwait(NULL)5 defwait(NULL)6 defwait(NULL)7 defwait(NULL)"
660 [153]" def (NULL) defwait(NULL) defwait(NULL) defwait(NULL) defwait(NULL) defwait(NULL) defwait(NULL) defwait(NULL)"
670 [153]" def (NULL) defwait(NULL) defwait(NULL) defwait(NULL) defwait(NULL) defwait(NULL) defwait(NULL) defwait(NULL)"
680 [153]" def /tantantantan>tantantantan>tantantantan>tantantantan>tantantantan>tantantantan>tantantantanexp"
690 [153]" (NULL)ove (NULL)umber:"
700 [129]i[178]1[164]7:[153]"def wait";:[130]
702 [129]i[178]217[164]242:[151]i,[194](i)[176]128:[130]
704 [151]214,17:[153]:[153]"def (NULL)ress (NULL) to (NULL)uit
710 s$=" "
720 :
730 rem sprite creation
740 :
750 s=53248:fori=0to62:readn:poke832+i,n:next
760 fori=2040to2047:pokei,13:next
770 fori=1to3:pokes+39+i,0:pokes+43+i,1:next
780 fori=3to15step2:pokes+i,92:next
790 fori=2to12step2:pokes+i,12+i*20:next
800 pokes+16,128:pokes+14,36
810 pokes+29,0:pokes+23,0:pokes+21,238
820 :
830 rem input move color
840 :
850 m=m+1:p=1449:gosub1240:print""m
860 p=1824:gosub1240:fori=1to4:prints$:next
870 p=1834:gosub1240:print"[154][205]ove [195]olor ([194][154]/[215][154]): [157]";:gosub1310:c$=g$
880 ifc$="w"orc$="[215]"then940
890 ifc$="b"orc$